import { RouteRecordRaw } from 'vue-router'
import cart from './modules/cart'
import category from './modules/category'
import user from './modules/user'
import index from './modules/index'
import error from './modules/error'

const Layout = () => import('@/layout/index.vue')

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/index',
    component: Layout,
  },
  ...index,
  ...category,
  ...cart,
  ...user,
  ...error,
  {
    path: '/:pathMatch(.*)*',
    name: 'notFound',
    redirect: '/error/404',
  },
]

export default routes
